package tpcompiladores;

import java.util.Hashtable;

public class Token {
    
    private Hashtable<Integer,String> conv;
    private int id;
    private String key;
    
    public Token(int id, String key){
        conv = new Hashtable<Integer,String>();
        cargarHash();
        this.id = id;
        this.key = key;
    }
    
    public int getId(){
        return id;
    }
    
    public String getKey(){
        return key;
    }
    
    public String getStringId(){
        return conv.get(id);
    }
    
    public void print(){
        System.out.println(conv.get(id) +"    " + key);
    }
    
    public void cargarHash(){
        conv.put(274,"CADENA DE UNA LINEA");
        conv.put(273,"CONSTANTE DOUBLE");
        conv.put(272,"IDENTIFICADOR");
        conv.put(271,"SIMBOLO <");
        conv.put(270,"SIMBOLO <=");
        conv.put(269,"SIMBOLO<>");
        conv.put(268,"SIMBOLO >");
        conv.put(267,"SIMBOLO >=");
        conv.put(266,"ASIGNACION :=");
        conv.put(265,"PALABRA RESERVADA UNTIL");
        conv.put(264,"PALABRA RESERVADA DO");
        conv.put(263,"PALABRA RESERVADA DOUBLE");
        conv.put(262,"PALABRA RESERVADA ARRAY");
        conv.put(261,"PALABRA RESERVADA VAR");
        conv.put(260,"PALABRA RESERVADA PRINT");
        conv.put(259,"PALABRA RESERVADA ELSE");
        conv.put(258,"PALABRA RESERVADA THEN");
        conv.put(257,"PALABRA RESERVADA IF");  
        conv.put(59,"SIMBOLO ;");
        conv.put(43,"SIMBOLO +");
        conv.put(45,"SIMBOLO -");
        conv.put(42,"SIMBOLO *");
        conv.put(47,"SIMBOLO /");
        conv.put(40,"SIMBOLO (");
        conv.put(41,"SIMBOLO )");
        conv.put(123,"SIMBOLO {");
        conv.put(125,"SIMBOLO }");
        conv.put(91,"SIMBOLO [");
        conv.put(93,"SIMBOLO ]");
        conv.put(44,"SIMBOLO ,");       
    }
    
}
